<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCardsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cards', function (Blueprint $table) {
            $table->increments('id')->unsigned();
            $table->integer('origin_id')->unsigned()->default(0)->index('origin_id')->comment('发起用户id');
            $table->integer('receive_id')->unsigned()->default(0)->index('receive_id')->comment('接收用户id');
            $table->string('name',100)->index('name')->default(NULL);
            $table->text('des')->default(NULL);
            $table->tinyInteger('is_use')->index('is_use')->default(0)->comment('是否使用1：使用，0：未使用');
            $table->date('headline_time')->index('headline_time')->comment('截止使用时间');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cards');
    }
}
